package com.hbnu.service.impl;

import com.hbnu.domain.Books;
import com.hbnu.mapper.BooksMapper;
import com.hbnu.service.BooksService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BooksServiceImpl implements BooksService {

    @Autowired
    private BooksMapper booksMapper;

    public List<Books> findAllBooks() {
        return booksMapper.findAllBooks();
    }

    public Books findBook(int bid) {
        return booksMapper.findBook(bid);
    }

    public String findbName(int bid) {
        return booksMapper.findbName(bid);
    }

    public int lendBook(int bid) {
        return booksMapper.lendBook(bid);
    }

    public int returnBook(int bid) {
        return booksMapper.returnBook(bid);
    }

    public int addBook(Books book){
        return booksMapper.addBook(book);
    }

    public int updateBook(Books book){
        return booksMapper.updateBook(book);
    }

    public int deleteBook(int bid){
        return booksMapper.deleteBook(bid);
    }
}
